Task #M008F

Memory 16 MB Time 1000 ms Complexity 15 %
14

  

Guess the number!

Guess the number!

This is an interactive challenge!

The program of the jury members will choose the number N (1 N 10). Your task is to find this number in no more than 100 queries. In each, you print one number Х (-231 X < 231), and the program outputs in response:

sign ‘>’ if X> N, or

sign '<' if X < N or

sign '=' if X = N


Input:

After each request, the program displays one of these characters on a new line: ‘>’, ‘<’, ‘=’.


Output:

Find the hidden number in no more than 100 queries. The last number printed is considered your answer.

NOTE: In interactive tasks, so that your solution does not receive the “Presentation Error” verdict, do not forget to throw the buffer:

  • In Pascal language: flush (output)
  • In C and C ++ languages: fflush (stdout) or cout.flush ()
  • In Java: System.out.flush ()
  • In Python: sys.stdout.flush ()
  • In C #: Console.Out.Flush ()

Examples
# input.txt output.txt
1
>
<
>
=
6
3
5
4
Submit answer
Please, sing in, to complete this action, if you don't have account, you can sign up any moment